home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -screenplay- / hd_installers / -whdload- / whdload_dev / src / sources / stfix.s < prev   
Text File  |  1998-07-16  |  1KB  |  52 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    stfix.s
  3. ;  :Contents.    routine to fix the old soundtracker playback routine
  4. ;        this old routine used in many games and demos contains an
  5. ;        empty dbf loop which wont work correctly on faster machines
  6. ;        the dbf loop will be replaced by a wait based on the vertical
  7. ;        raster position
  8. ;  :Version.    $Id: stfix.s 1.1 1998/06/14 20:53:41 jah Exp $
  9. ;  :History.    30.08.97 extracted from slave sources
  10. ;  :Requires.    -
  11. ;  :Copyright.    Public Domain
  12. ;  :Language.    68000 Assembler
  13. ;  :Translator.    Barfly V1.131
  14. ;  :To Do.
  15. ;---------------------------------------------------------------------------*
  16. ;
  17. ; bad stuff (contained 2 times):
  18. ;        move.w    #$12c,d0    ;303c 012c
  19. ;    .loop    dbf    d0,.loop    ;51c8 fffe
  20. ;
  21. ; the routine will scan the given memory area and patch the bad stuff
  22. ;
  23. ; IN:    A0 = APTR start of memory to patch
  24. ;    A1 = APTR end of memory to patch
  25. ; OUT:    d0-d1/a0-a1 destroyed
  26.  
  27. _stfix        subq.l    #7,a1
  28. .s0        cmp.w    #$303c,(a0)
  29.         bne    .s1
  30.         cmp.w    #$012c,(2,a0)
  31.         bne    .s1
  32.         cmp.l    #$51c8fffe,(4,a0)
  33.         bne    .s1
  34.         move.w    #$4eb9,(a0)+        ;JSR xxxxxxxx.L
  35.         pea    (.wait,pc)
  36.         move.l    (a7)+,(a0)
  37. .s1        addq.l    #2,a0
  38.         cmp.l    a0,a1
  39.         bhi    .s0
  40.         rts
  41.  
  42. .wait        move.l    d1,-(a7)
  43.         moveq    #8,d1            ;8.5 * 63.5µs = 0.54 ms
  44. .1        move.b    $dff006,d0
  45. .2        cmp.b    $dff006,d0
  46.         beq    .2
  47.         dbf    d1,.1
  48.         move.l    (a7)+,d1
  49.         addq.l    #2,(a7)
  50.         rts
  51.  
  52.